
clear

use "NYCHA_deidentified"

** TABLE 1 + 2

foreach type in trash litter  {	

display "`type' no controls LAG "

xi: nbreg `type' tilt_treated_week_lag intervention_week i.site_number i.week, r

display "`type'  RA controls LAG "

xi: nbreg `type' tilt_treated_week_lag intervention_week i.site_number i.week i.RA_number, r

display "`type' dow controls LAG "

xi: nbreg `type' tilt_treated_week_lag intervention_week i.site_number i.week i.dow, r

display "`type' dow controls LAG "

xi: nbreg `type' tilt_treated_week_lag intervention_week i.site_number i.week i.hour, r

display "`type' all controls LAG "

xi: nbreg `type' tilt_treated_week_lag intervention_week i.site_number i.week i.RA_number i.dow i.hour, r
}


*** Figures 1 + 2 ****

preserve

bysort site_number: keep if _n==1

xtile litter_qt = litter_before, nq(4)
xtile trash_qt = trash_before, nq(4)

bysort litter_qt: ttest litter_after, by(treatment)
bysort trash_qt: ttest trash_after, by(treatment)

restore

**Appendix Figure 1**

graph twoway histo hour, by(treatment) width(1)
